// https://nuxt.com/docs/api/configuration/nuxt-config

const baseURL = process.env.NUXT_PUBLIC_PATH

console.log(baseURL)

export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: { enabled: true },
  app: {
    baseURL,
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          // additionalData: `@use "@/styles/element-vars.scss" as element;`,
          api: 'modern-compiler', // or "modern",
          silenceDeprecations: ['legacy-js-api'],
        },
      },
    },
  },
  modules: [
    '@vueuse/nuxt',
    [
      '@vant/nuxt',
      {
        lazyload: { lazyComponent: true },
        defaultLocale: 'en-US',
      },
    ],
  ],
  vant: {
    importStyle: false,
  },
  postcss: {
    plugins: {
      'postcss-pxtorem': {
        rootValue: 16,
        propList: ['*'],
      },
    },
  },
  routeRules: {
    '/': { redirect: `${baseURL}flight` },
  },
})
